Skip to content

feat: enable paste for empty array fields#924

Merged
stevenle merged 3 commits intomainfrom
codex/add-paste-option-to-array-field-ui
Feb 26, 2026
Merged

feat: enable paste for empty array fields#924
stevenle merged 3 commits intomainfrom
codex/add-paste-option-to-array-field-ui

Conversation

@stevenle
Copy link
Member

Motivation

  • Array fields did not allow pasting when there were no items, making it impossible to paste from the virtual clipboard into an empty list.

Description

  • Add a split action row in DocEditor.ArrayField so the primary Add button remains and a dropdown menu sits beside it in packages/root-cms/ui/components/DocEditor/DocEditor.tsx.
  • Add a Paste menu item that invokes pasteFromVirtualClipboard(order.length - 1) so paste works even when the array is empty.
  • Add CSS .DocEditor__ArrayField__add__actions in packages/root-cms/ui/components/DocEditor/DocEditor.css to layout the add button and dropdown inline with spacing.

Testing

  • Attempted to run pnpm -C packages/root-cms build:ui, which failed due to the environment being unable to download pnpm (Corepack network/proxy 403), so the package build could not be validated here.
  • Attempted a Playwright screenshot of a local dev server, which failed with ERR_EMPTY_RESPONSE because no web app was available at the target port in this environment.
  • No automated tests were added or executed as part of this change.

Codex Task

@stevenle stevenle changed the title fix(root-cms): enable Paste for empty ArrayField via Add dropdown fix: enable paste for empty array fields Feb 24, 2026
@stevenle stevenle self-assigned this Feb 25, 2026
@stevenle stevenle changed the title fix: enable paste for empty array fields feat: enable paste for empty array fields Feb 26, 2026
@stevenle
Copy link
Member Author

@jeremydw this is ready for review, the main goal of this is to add a way to "paste" when there are no array items (currently you have to add a blank one, paste, and then remove the empty item)

Screenshot 2026-02-25 at 4 28 54 PM

@stevenle stevenle requested a review from jeremydw February 26, 2026 00:33
@stevenle stevenle assigned jeremydw and unassigned stevenle Feb 26, 2026
@jeremydw
Copy link
Member

It's a bit awkward but I can't think of a better UI for this without a bigger refactor (like having an "empty items" list). Let's submit for now and refactor later

@stevenle stevenle merged commit e039a74 into main Feb 26, 2026
1 check passed
@stevenle stevenle deleted the codex/add-paste-option-to-array-field-ui branch February 26, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants